home *** CD-ROM | disk | FTP | other *** search
/ PC Media 23 / PC MEDIA CD23.iso / share / prog / date50 / date_man.txt next >
Encoding:
Text File  |  1994-12-10  |  32.4 KB  |  900 lines

  1.                                              class Date - 16
  2.                          Date Class
  3. class Date                                               2
  4.      Derivation                                          2
  5.      Public Members                                      2
  6.      Member Functions                                    4
  7.           Date::AddMonths                                4
  8.           Date::AddWeeks                                 4
  9.           Date::AddYears                                 4
  10.           Date::BOM                                      5
  11.           Date::BOY                                      5
  12.           Date::CDOW                                     5
  13.           Date::CMonth                                   5
  14.           Date Comparison Operators                      6
  15.           Date::Date                                     6
  16.           Date::Day                                      8
  17.           Date::DaysInMonth                              8
  18.           Date::DOY                                      8
  19.           Date::EOM                                      8
  20.           Date::eom                                      9
  21.           Date::EOY                                      9
  22.           Date::FirstDOM()                               9
  23.           Date::formatDate                               9
  24.           Date::getDate                                  10
  25.           Date Holiday Constructors                      10
  26.           Date::isLeapYear                               11
  27.           Date::isDST                                    11
  28.           Date::julDate                                  11
  29.           Date::NDOW                                     12
  30.           Date::NMonth                                   12
  31.           Date::NYear4                                   12
  32.           Date::operator <<                              12
  33.           Date::operator const char *                    13
  34.           Date::operator +,-                             13
  35.           Date::operators +=, -=                         13
  36.           Date::operators ++, --                         14
  37.           Date::Set                                      14
  38.           Date::setCentury                               14
  39.           Date::setDST                                   15
  40.           Date::setFormat                                15
  41.           Date::setSTD                                   15
  42.           Date::setOption                                15
  43.           Date::WOM                                      16
  44.           Date::WOY                                      16
  45.           class Date
  46.        A Date object represents absolute dates.  It allows
  47.         conversion to and from a selection of ASCII
  48.         representations, and a complete set of arithmetic
  49.         operations.   Date values are based on the number
  50.         of days since 4713BCE.
  51.  
  52. Derivation
  53.         The Date class was not designed for derivation.
  54.         Because there are no virtual functions, the size of
  55.         Date object is exactly 12 bytes, assuming a
  56.         compiler making shorts 2 bytes, and longs 4 bytes.
  57.  
  58. Public Members
  59.  
  60.  
  61.        Construction/      
  62.        Destruction
  63.        Date               Creates Date objects in various
  64.                           ways.
  65.        NewYearsDay        Creates a Date object the
  66.        PresidentsDay      represent the listed holiday.
  67.        ValentinesDay,     (static member functions)
  68.        etc.
  69.        BOM, EOM, BOY,     Create  Date objects that
  70.        EOY                represents the first & final days
  71.                           of the month & year in which the
  72.                           given Date object falls.
  73.                           
  74.        Extraction         
  75.        CDOW               Returns as a Character string the
  76.                           day of the Week that  this Date
  77.                           object represents.  ('Sunday' ..
  78.                           'Saturday')
  79.        CMonth             Returns as a character string the
  80.                           month that is Date object
  81.                           represents ("January"...
  82.                           "December"
  83.        Day                Returns the day of the month that
  84.                           this Date object represents.
  85.        DaysInMonth        Returns the number of days in the
  86.                           month of this Date object.
  87.                           (28..31)
  88.        DOY                Returns as an integer the
  89.                           relative date since Jan. 1
  90.        FirstDOM           Returns as an integer the day of
  91.                           the week of the first day of the
  92.                           month in which this Date object
  93.                           falls.
  94.        julDate            Returns Julian date (days since
  95.                           4713BCE) as a long.
  96.        NDOW               Returns as a integer the day of
  97.                           the week that this Date object
  98.                           represents (1 = Sunday, 7 =
  99.                           Saturday)
  100.        NMonth             Returns as an integer the month
  101.                           that this Date object represents.
  102.        NYear4             Returns as an integer the year
  103.                           this Date object represents.
  104.        WOM                Returns the Week Of Month  (1..6)
  105.                           this Date falls in.
  106.        WOY                Returns the Week Of Year  (1..52)
  107.                           this Date object falls in.
  108.                           
  109.        Conversion         
  110.        getDate            Returns as an MSDOS date_t
  111.                           structure, the date represented
  112.                           by the Date object.
  113.        eom                Returns as an MSDOS date_t, the
  114.                           last day of month this Date
  115.                           object represents.
  116.                           
  117.        Operators          
  118.        operator +,-       Adds and subtracts days (given as
  119.                           ints or longs) to Date objects.
  120.        operator -         Subtracts one Date object from
  121.                           another returning as a long, the
  122.                           number of days between them.
  123.        operator +=, -=    Adds & subtracts a number of days
  124.                           to and from this Date object.
  125.        operator ++, --    Pre- & postfix incrementor &
  126.                           decrementor, alters Date object
  127.                           by one day.
  128.        operator==,<,      Compares two absolute Dates.
  129.        etc.
  130.                           
  131.        Operations         
  132.        AddMonths          Adds months to the Date Object
  133.                           (adjusts year as required)
  134.        AddWeeks           Adds weeks to the Date Object.
  135.        AddYears           Adds years to the Date Object.
  136.        isLeapYear()       Returns true if leap year, false
  137.                           if not
  138.        Set                Full set of functions to set an
  139.                           existing Date object to a new
  140.                           value  (to complement the set of
  141.                           constructors)
  142.        isDST              returns true if in Daylight
  143.                           Saving Time, false if not.
  144.                           
  145.        Archive/Dump       
  146.        operator <<        Outputs a Date object to a
  147.                           ostream object.
  148.  
  149. Member Functions
  150.  
  151.             
  152.             Date::AddMonths
  153.             
  154. Syntax      Date &AddMonths( int nCount =1);
  155.             
  156. Parameters  nCount
  157.                  Indicates the number of months to add.
  158.             
  159. Remarks     This function allows you to add (or subtract,
  160.             if nCount is negative)  months to a Date
  161.             object.
  162.             
  163. Example     Date d1 = Date("01/15/93");
  164.             d1.AddMonths(3);
  165.             assert( d1 == Date("04/15/93"));
  166.  
  167.             
  168.             Date::AddWeeks
  169.             
  170. Syntax      Date &AddWeeks( int nCount =1);
  171.             
  172. Parameters  nCount
  173.                  Indicates the number of weeks to add.
  174.             
  175. Remarks     This function allows you to add (or subtract,
  176.             if nCount is negative)  weeks to a Date object.
  177.             
  178. Example     Date d1 = Date("01/15/93");
  179.             d1.AddWeeks(3);
  180.             assert( d1 == Date("02/05/93"));
  181.  
  182.             
  183.             Date::AddYears
  184.             
  185. Syntax      Date &AddYears( int nCount =1);
  186.             
  187. Parameters  nCount
  188.                  Indicates the number of years to add.
  189.             
  190. Remarks     This function allows you to add (or subtract,
  191.             if nCount is negative)  years to a Date object.
  192.             
  193. Example     Date d1 = Date("01/15/93");
  194.             d1.AddYears(3);
  195.             assert( d1 == Date("01/15/96"));
  196.  
  197.             
  198.             Date::BOM
  199.             
  200. Syntax      inline Date BOM(void) const;
  201.             
  202. Remarks     Returns a new Date  object  which represents
  203.             the first day of the month of this Date object.
  204.             
  205. Example     Date d1 = Date("07/04/93");
  206.             Date d2 = d1.BOM();
  207.             assert(d2 == Date("07/01/93"));
  208.  
  209.             
  210.             Date::BOY
  211.             
  212. Syntax      inline Date BOY(void) const;
  213.             
  214. Remarks     Returns a new Date  object  which represents
  215.             the first day of the year of this Date object.
  216.             
  217. Example     Date d1 = Date("07/04/93");
  218.             Date d2 = d1.BOY();
  219.             assert(d2 == Date("01/01/93"));
  220.  
  221.             
  222.             Date::CDOW
  223.             
  224. Syntax      inline    const char *CDOW(void) const
  225.             
  226. Remarks     Returns a pointer to a string holding the day of
  227.             the week  ('Sunday'..'Saturday').  Note: That
  228.             all calls to CDOW, as well as CMonth and
  229.             formatDate share a common buffer, and subsequent
  230.             calls overwrite previous strings.
  231.             
  232. Example     Date  d1 = Date("09/01/1993");
  233.             assert(strcmp(d1.CDOW(), "Wednesday") == 0);
  234.  
  235.             
  236.             Date::CMonth
  237.             
  238. Syntax      inline    const char * CMonth() const;
  239.             
  240. Remarks     Returns a pointer to a string holding the name
  241.             of the month of this Date object
  242.             ('January'...'December').
  243.              Note: That all calls to CMonth, as well as
  244.             CDOW and formatDate share a common buffer, and
  245.             subsequent calls overwrite previous strings.
  246.             
  247. Example     Date d1 = Date("09/01/1993");
  248.             assert(strcmp(d1.CMonth(), "September")==0);
  249.  
  250.             
  251.             Date Comparison Operators
  252.             
  253. Syntax      inline    int  operator <  (const Date &date)
  254.             const;
  255.             inline    int  operator <= (const Date &date)
  256.             const;
  257.             inline    int  operator >  (const Date &date)
  258.             const;
  259.             inline    int  operator >= (const Date &date)
  260.             const;
  261.             inline    int  operator == (const Date &date)
  262.             const;
  263.             inline    int  operator != (const Date &date)
  264.             const;
  265.             
  266. Remarks     These operators  compare two absolute dates and
  267.             return TRUE if the condition is true; otherwise
  268.             FALSE.
  269.             
  270. Example     Date d1 = Date("Today");
  271.             Date d2 = d1 + 30;  // 30 days later.
  272.             assert( d1 != d2);
  273.             assert( d1 < d2);
  274.             assert( d1<=d2);
  275.             
  276.  
  277.             Date::Date
  278.             
  279. Syntax      Date();
  280.             Date ( int nMonth, int nDay,  int nYear );
  281.             Date ( long lJulian);
  282.             Date (const char * szDate);
  283.             Date (const Date & dtDateSrc);
  284.             Date (const tm & TM);
  285.             Date (int nWeeknum, int nDow,  int nMonth, int
  286.             nYear);
  287.             Date (const DOSDATE_T &ds);
  288.             
  289.             
  290. Parameters  dtDateSrc
  291.                 Indicates a Date object which already exists
  292.             
  293.             nMonth, nDay, nYear
  294.                 Indicates month, day of month, and year.
  295.             
  296.             lJulian
  297.                 Indicates the number of days from 2714BCE.
  298.             
  299.             szDate
  300.                 Indicates a character string containing a
  301.             formatted date.
  302.             
  303.             nWeeknum, nDOW
  304.                 Indicates the week number of the month, and
  305.             the day of the week.
  306.             
  307.             TM
  308.                 Indicates a TM struct value.
  309.             
  310.             ds
  311.                 Indicates a MSDOS  date struct value.
  312.             
  313.             
  314. Remarks     All these constructor create a new Date object
  315.             initialized with the specified absolute date.
  316.             
  317.             Each constructor is described below:
  318.             
  319.             Date();
  320.                Constructs a new Date object with a zero
  321.             (illegal) date.
  322.                Note  Zero is an invalid date. This
  323.             constructor is provided to allow the definition
  324.             of Date object arrays.  You should initialize
  325.             such arrays with valid dates prior to use.
  326.             
  327.             Date (const Date & dtDateSrc);
  328.                 Constructs a Date object from another Date
  329.             value.
  330.             
  331.             Date ( int nMonth, int nDay,  int nYear );
  332.                 Constructs a Date object from the given
  333.             components, with each component constraint to
  334.             the following ranges:
  335.             Component      Range
  336.             nYear          -4713 - 9999
  337.             nMonth         1-12 or one of the Months enums
  338.                            (JANUARY, FEBRUARY etc.)
  339.             nDay           1-31
  340.                            
  341.             Date (int nWeeknum, int nDow,  int nMonth, int
  342.             nYear);
  343.                 Constructs a Date object from the given
  344.             components, with each component constraint to
  345.             the following ranges:
  346.             Component      Range
  347.             nWeeknum       0-5
  348.             nDOW           1-7 or one of the Wday enums
  349.                            (SUNDAY, MONDAY, etc.)
  350.             nYear          -4713 - 9999
  351.             nMonth         1-12 or one of the Months enums
  352.                            (JANUARY, FEBRUARY etc.)
  353.             This constructor allows you to build a Date
  354.             object which is, for example, "The third
  355.             Wednesday in March, 1993".  If nWeeknum is
  356.             Zero (0),   the object created will be the
  357.             date  of the last weekday of that type in the
  358.             month.
  359.             
  360.             Date (const char * szDate);
  361.               Constructs a Date object from a character
  362.             string.  The string may be in any of the
  363.             following formats:  (These are also the
  364.             formats in which a Date can be output.)  The
  365.             constructor will determine which format it is.
  366.                  "09/05/1993"
  367.                  "5 Sep 93"
  368.                  "Sun Sept 5, 1993"
  369.                  "Sunday September 5, 1993"
  370.             Leading zeros and the century are allowed but
  371.             not required on all the above formats.   If
  372.             the century is missing, the date is assumed to
  373.             be in the 1900s.
  374.                  "19930905"
  375.                  "Today"  or  "."
  376.             These last two formats set the Date object to
  377.             todays date.  The word "Today" is not case
  378.             sensitive.  The period format (".") was added
  379.             to ease manual data entry.
  380.             
  381.             Date (const tm & TM);
  382.                 Constructs a Date object from a tm type.
  383.             
  384.             Date (const DOSDATE_T &ds);
  385.                 Constructs a Date object from a MSDOS
  386.             dosdate_t type.
  387.             
  388. Examples    Date date1(10,30,1962);  // October 30, 1962
  389.             Date date2(Date::OCTOBER, 30, 1962);    //
  390.             same
  391.             Date date3 = "8/8/88";   // August 9, 1988
  392.             Date date4(2450000L);    // From a Julian
  393.             Date date5(2,Date::SUNDAY,Date::MAY, 1993);
  394.                                 // 2nd Sunday in May
  395.             
  396.  
  397.             
  398.             Date::Day
  399.             
  400. Syntax      inline int Day(void) const;
  401.             
  402. Remarks     Returns the day of the month, in the range 1
  403.             through 31.
  404.             
  405. Example     Date d1("09/11/1993");
  406.             assert(d1.Day() == 11);
  407.  
  408.             
  409.             Date::DaysInMonth
  410.             
  411. Syntax      unsigned int DaysInMonth(void) const ;
  412.             
  413. Remarks     Returns the number of days in the month of this
  414.             Date object, in the range 1  to  31.
  415.             
  416. Example     Date d1("09/11/1993");
  417.             assert(d1.DaysInMonth() == 30);
  418.  
  419.             
  420.             Date::DOY
  421.             
  422. Syntax      int DOY(void) const;
  423.             
  424. Remarks     Returns the number of days since Jan. 1 for
  425.             this Date object, in the range 1 to 366.
  426.             
  427. Example     Date d1("02/15/1993");
  428.             assert(d1.DOY() == 46);
  429.  
  430.             
  431.             Date::EOM
  432.             
  433. Syntax      inline Date EOM(void) const;
  434.             
  435. Remarks     Returns a new Date  object  which represents
  436.             the last day of the month of this Date object.
  437.             
  438. Example     Date d1 = Date("07/04/93");
  439.             Date d2 = d1.EOM();
  440.             assert(d2 == Date("07/31/93"));
  441.  
  442.             
  443.             Date::eom
  444.             
  445. Syntax      DOSDATE_T eom(void) const;
  446.             
  447. Remarks     Returns a DOSDATE struct containing  a
  448.             decomposition of the date of the last day of
  449.             the month contained in this Date object.
  450.             
  451.             Note This function may only be  available with
  452.             MSDOS based compilers.  See the note for
  453.             getDate for structure layout.
  454.             
  455. Example     Date d1("09/11/1993");
  456.             DOSDATE_T  ddt;
  457.             ddt = d1.eom();
  458.             assert(ddt.day == 30);
  459.  
  460.             
  461.             Date::EOY
  462.             
  463. Syntax      inline Date EOY(void) const;
  464.             
  465. Remarks     Returns a new Date object  which represents the
  466.             last day of the year of this Date object.
  467.             
  468. Example     Date d1 = Date("07/04/93");
  469.             Date d2 = d1.EOY();
  470.             assert(d2 == Date("12/31/93"));
  471.  
  472.             
  473.             Date::FirstDOM()
  474.             
  475. Syntax      inline int FirstDOM() const ;
  476.             
  477. Remarks     Returns the numeric code  indicating the day of
  478.             the week the first day of the month of this date
  479.             object falls, in the range 1 through 7, where
  480.             Sunday is 1.  These correspond to the enum Wday
  481.             values.
  482.             
  483. Example     Date d1("09/11/1993");
  484.             assert(d1.FirstDOM() == Date::WEDNESDAY);
  485.  
  486.             
  487.             Date::formatDate
  488.             
  489. Syntax      char * formatDate( int nType = DisplayFormat)
  490.             const;
  491.             
  492. Parameters  nType
  493.                  One of the format_type enum.   If nType is
  494.                  not given, it defaults to the current
  495.                  setting of the DisplayFormat class
  496.                  variable, which is initialized to MDY, but
  497.                  can be changes with the class function
  498.                  setFormat.
  499.                  
  500. Remarks          The following values yield the indicated
  501.                  formats:
  502.                      
  503.             MDY      "9/5/1993"
  504.             DAY      "Sunday"
  505.             MONTH    "September"
  506.             FULL     "Sunday, September 5, 1993"
  507.             EUROPEA  "5 September 1993"
  508.             N
  509.             COLLATE  "19930905"
  510.             Setting the Display options to DATE_ABBR
  511.             and/or NO_CENTURY will affect the appearance of
  512.             the above formats, except for COLLATE.
  513.                  
  514. Example     Date d1("09/11/1993");
  515.             const char *p = d1.formatDate(Date::FULL);
  516.             assert(strcmp(p, "Saturday, September 11,
  517.             1993")==0);
  518.             p = d1.formatDate(Date::COLLATE);
  519.             assert(strcmp(p, "19930911")==0);
  520.             Date::setFormat(Date::EUROPEAN);
  521.             p = d1.formatDate();
  522.             assert(strcmp(p, "11 September 1993")==0);
  523.  
  524.             
  525.             Date::getDate
  526.             
  527. Syntax      DOSDATE_T getDate() const;
  528.             
  529. Remarks     Returns a DOSDATE_T struct  that contains the
  530.             decomposition of the date contained in this
  531.             Date object.
  532.             
  533.             Note  The actual name and location of DOSDATE_T
  534.             is implementation defined, and the structure
  535.             and function may only available with MSDOS
  536.             based compilers.  The members are as follows:
  537.             
  538.             Field          Value stored
  539.             _
  540.             day       Day of the month: (1-31)
  541.             month          Month of the year: (1-12)
  542.             year      Year: (0-119 relative to 1980)
  543.             dayofweek Day of the week: 0-6 (Sunday is 0)
  544.             
  545.             
  546. Example     Date d1("09/11/1993");
  547.             DOSDATE_T  ddt;
  548.             ddt = d1.getDate();
  549.             assert(ddt.day == 11);
  550.  
  551.             
  552.             Date Holiday Constructors
  553.             
  554. Syntax      static Date::NewYearsDay(int nYear);
  555.             static Date::PresidentsDay(int nYear);
  556.             static Date::ValentinesDay(int nYear);
  557.             static Date::StPatricksDay(int nYear);
  558.             static Date::MothersDay(int nYear);
  559.             static Date::MemorialDay(int nYear);
  560.             static Date::FlagDay(int nYear);
  561.             static Date::FathersDay(int nYear);
  562.             static Date::CanadaDay(int nYear);
  563.             static Date::IndependenceDay(int nYear);
  564.             static Date::BastilleDay(int nYear);
  565.             static Date::LaborDay(int nYear);
  566.             static Date::VeteransDay(int nYear);
  567.             static Date::ThanksgivingDay(int nYear);
  568.             static Date::ChristmasDay(int nYear);
  569.             
  570. Parameters  nYear
  571.                 The year in which the Date represented by
  572.             the new object is to fall.
  573.             
  574. Remarks     Returns a Date object represent the date of the
  575.             holiday.
  576.             
  577. Example     Date d = Date::PresidentsDay(1993);
  578.             assert(d == Date("02/15/1993"));
  579.             
  580.  
  581.             
  582.             Date::isLeapYear
  583.             
  584. Syntax      bool  isLeapYear(void) const;
  585.             
  586. Remarks     Returns true if the year represented by this
  587.             Date object is a leap year, false if not.
  588.             
  589. Example     Date d("09/11/1993");
  590.             assert(d.isLeapYear() == false);
  591.  
  592.  
  593.             
  594.             Date::isDST
  595.             
  596. Syntax      bool Date::isDST( void ) const
  597.             
  598. Remarks     Returns true if the date represented by this
  599.             Date object is within Daylight Savings Time.
  600.             
  601. Example     Date d(Date::JULY, 4, 1993);
  602.             assert(d.isDST == true);
  603.  
  604.  
  605.             
  606.             Date::julDate
  607.             
  608. Syntax      inline long julDate() const;
  609.             
  610. Remarks     Returns the Julian date (the number of  days
  611.             since 1/1/4713BC).
  612.             
  613. Example     Date d(Date::JULY, 4, 1993);
  614.             assert(d.julDate() == 2449172);
  615.  
  616.             
  617.             Date::NDOW
  618.             
  619. Syntax      inline int NDOW(void) const;
  620.             
  621. Remarks     Returns the numeric code  indicating the day of
  622.             the week  this date object falls, in the range
  623.             1 through 7, where Sunday is 1.  These
  624.             correspond to the enum Wday values.
  625.             
  626. Example     Date d=Date(Date::SEPTEMBER, 11,1993);
  627.             assert(d.NDOW() == 7);
  628.             assert(d.NDOW() == Date::SATURDAY);
  629.  
  630.             
  631.             Date::NMonth
  632.             
  633. Syntax      inline int  NMonth(void) const;
  634.             
  635. Remarks     Return the months in the range 1 through 12.
  636.             These correspond to the enum Months.
  637.             
  638. Example     Date d("09/11/1993");
  639.             assert(d.NMonth() == 9);
  640.  
  641.             
  642.             Date::NYear4
  643.             
  644. Syntax      inline int NYear4() const;
  645.             
  646. Remarks     Returns the year, in the range -4713 through
  647.             9999.
  648.             
  649. Example     Date d1= "Today";
  650.             assert( (d1.NYear4() >= 1993) && ( d1.NYear4()
  651.             <=2000)  );
  652.  
  653.             
  654.             Date::operator <<
  655.             
  656. Syntax      friend ostream &operator << (ostream &os,
  657.             const Date &dDate);
  658.             friend ostream &operator << (ostream &os,
  659.             const DOSDATE_T &ddt);
  660.             friend ostream &operator << (ostream &os, enum
  661.             format_type ft);
  662.             
  663. Remarks     Outputs the formatted Date object to the
  664.             ostream object.  Format is based on the
  665.             current default setting, and can be changed by
  666.             Date::setFormat, or by outputing the format
  667.             type.   An output operator is also provided
  668.             for the non-class DOSDATE_T structure.
  669.             
  670. Example     Date d1="Today";
  671.             cout << "Today is " << Date::EUROPEAN << d1 <<
  672.             endl;
  673.  
  674.             
  675.             Date::operator const char *
  676.             
  677. Syntax      operator const char *( void );
  678.             
  679. Remarks      This casting operator provides an efficient
  680.             method to access  a NULL-terminated character
  681.             string  representing the Date object.  No
  682.             characters are copied,; only a pointer is
  683.             returned.  The appearance of the string  is
  684.             based on the current  format established by
  685.             Date::setFormat. The default is MDY.
  686.             
  687.             Note The buffer whose address is returned by
  688.             this operator is shared by  all Date objects
  689.             and used by CDOW,  CMonth and formatDate, and
  690.             subsequent calls overwrite previous strings.
  691.             
  692. Example     Date d1("09/11/1993");
  693.             Date::setFormat(Date::FULL);
  694.             assert(strcmp(d1, "Saturday, September 11,
  695.             1993")==0);
  696.  
  697.             
  698.             Date::operator +,-
  699.             
  700. Syntax      inline Date Date::operator + (long lDays)    const;
  701.             inline Date Date::operator + (int nDays)     const;
  702.             inline Date Date::operator - (long lDays)    const;
  703.             inline Date Date::operator - (int nDays)     const;
  704.             inline long Date::operator - (const Date &date)   const;
  705.             
  706. Remarks     The first four operators allow you to add and
  707.             subtract days from Date objects.  The fifth
  708.             allows you to subtract one Date object from
  709.             another yields a long giving the number of
  710.             days.
  711.             
  712. Example     Date d1 = Date("08/15/1993");
  713.             Date d2 = d1 + 13;  // 13 days later.
  714.             assert( d2 == Date("08/28/1993"));
  715.  
  716.  
  717.             
  718.             Date::operators +=, -=
  719.             
  720. Syntax      Date &operator += (long lDays);
  721.             Date &operator -= (long lDays);
  722.             
  723. Remarks     These operators allow you to add and subtract
  724.             a number of days to and from this Date object.
  725.             
  726. Example     Date d1 = Date("08/15/1993");
  727.             d1 += 10; // 10 days later.
  728.             assert( d1 == Date("08/25/1993"));
  729.             assert( d1 < d2);
  730.             assert( d1<=d2);
  731.  
  732.  
  733.             
  734.             Date::operators ++, --
  735.             
  736. Syntax      Date  operator ++ ();
  737.             Date  operator ++ (int nDays);
  738.             Date  operator -- ();
  739.             Date  operator -- (int nDays);
  740.             
  741. Remarks     Pre- and Post-fix auto-increment operators.
  742.             Allow you to step the Date object one day at a
  743.             time.
  744.             
  745. Example     Date  d1("09/11/1993");
  746.             Date  d2("09/12/1993");
  747.             assert( d1 ++ < d2);
  748.             assert(d1 == d2);
  749.  
  750.             
  751.             Date::Set
  752.             
  753. Syntax      Date &Set(void);
  754.             Date &Set(long lJulian);
  755.             Date &Set(unsigned int nMonth, unsigned int
  756.             nDay, unsigned int nYear);
  757.             Date &Set(int nWeeknum, int nDow, short nMonth,
  758.             short nYear);
  759.             
  760. Remarks     These correspond to the constructors, and allow
  761.             you to change the value of any existing Date
  762.             object.
  763.             
  764. Example     Date d1, d2, d3;
  765.             d1.Set(); // Today's date.
  766.             d2.Set(Date::JANUARY, 15, 1975);
  767.             d3.Set(3, Date::SATURDAY, Date::JANUARY, 1987);
  768.             
  769.  
  770.             
  771.             Date::setCentury
  772.             
  773. Syntax      static int setCentury(short nCentury);
  774.             
  775. Parameters  nCentury
  776.                  The new default century value.
  777.             
  778. Remarks     Allows you do change the century assumed when
  779.             translating a date with a 2 digit year.    The
  780.             normal default value is "1900".  nCentury  must
  781.             be either a multiple of 100, or in the range 1
  782.             to 99.   In the later case, it is multiple by
  783.             100 by setCentury before it's used.
  784.             
  785. Example     Date::setCentury(1800);
  786.             Date  d1("9/11/93");
  787.             assert(d1 == Date("09/11/1893"));
  788.  
  789.             
  790.             Date::setDST
  791.             
  792. Syntax      bool Date::setDST(unsigned nMonth, unsigned
  793.             nDay) const
  794.             
  795. Remarks     Sets the date inwhich Daylight Savings Time is
  796.             assumed to begin. isDST() will return true for
  797.             any Date object from the Sunday before this
  798.             date. Returns false if the month or day given
  799.             were invalid.  Defaults to the dates for North
  800.             America.
  801.             
  802. Example     Date::setDST(Date::APRIL, 30);
  803.  
  804.             
  805.             Date::setFormat
  806.             
  807. Syntax      inline static void setFormat (enum format_type
  808.             nFormat);
  809.             
  810. Parameters  nFormat
  811.                  A value from the format_type enum.
  812.             
  813. Remarks     Allows you to change the default format used
  814.             by formatDate and operator const *.
  815.              Must be one of the following:
  816.             
  817.             Value          Example
  818.             _
  819.             MDY      "9/5/1993"
  820.             DAY      "Sunday"
  821.             MONTH    "September"
  822.             FULL     "Sunday, September 5, 1993"
  823.             EUROPEAN "5 September 1993"
  824.             COLLATE   "19930905"
  825.             
  826. Example     Date d1("09/11/1993");
  827.             Date::setFormat(Date::FULL);
  828.             assert(strcmp(d1, "Saturday, September 11,
  829.             1993")==0);
  830.  
  831.  
  832.             
  833.             Date::setSTD
  834.             
  835. Syntax      bool Date::setSTD(unsigned nMonth, unsigned
  836.             nDay) const
  837.             
  838. Remarks     Sets the date inwhich Daylight Savings Time is
  839.             assumed to end. isDST() will return false for
  840.             any Date object from the Sunday before this
  841.             date. Returns false if the month or day given
  842.             were invalid. Defaults to the dates for North
  843.             America.
  844.             
  845. Example     Date::setDST(Date::OCTOBER, 30);
  846.  
  847.  
  848.             
  849.             Date::setOption
  850.             
  851. Syntax      static bool setOption (enum Options nOption, int
  852.             nAction=ON);
  853.             
  854. Parameters  nOption
  855.                  A value from the enum Options.
  856.             nAction
  857.                  Either ON or OFF.
  858.             
  859. Remarks     Allows you to modify the formatting options, for
  860.             the class.  nOption must be one of the
  861.             following:
  862.             Value          Action
  863.             _
  864.             NO_CENTURY     Years are formatting uses only 2
  865.             digits.
  866.             DATE_ABBR      Month & Day of week names are
  867.             abbreviated to 3 letters
  868.             
  869. Example     Date::setOption(Date::DATE_ABBR);
  870.             Date::setFormat(Date::FULL);
  871.             Date  d1 = "9/11/1993";
  872.             assert(strcmp(d1.formatDate(), "Sat, Sep 11,
  873.             1993")==0);
  874.             Date::setOption(Date::NO_CENTURY,Date::ON);
  875.             assert(strcmp(d1.formatDate(), "Sat, Sep 11,
  876.             93")==0);
  877.  
  878.             
  879.             Date::WOM
  880.             
  881. Syntax      int WOM(void) const;
  882.             
  883. Remarks     Return the numeric week of the month, in the
  884.             range 1 through 6.
  885.             
  886. Example     Date d1 = "09/12/1993";
  887.             assert(d1.WOM() == 3);
  888.  
  889.             
  890.             Date::WOY
  891.             
  892. Syntax      int WOY(void) const;
  893.             
  894. Remarks     Returns the numeric week of the year, in the
  895.             range 1 through 52.
  896.             
  897. Example     Date d1 = "02/15/1993";
  898.             assert(d1.WOY() == 7);
  899.  
  900.